package com.ch.home.bean;

import java.util.Date;

/**
 * 商品类
 * Created by CHEN on 2019/8/24.
 * OK
 */
public class Commodity {
    private Integer commodityId;
    private String commodityName;
    private Integer commodityPrice;
    private Integer commodityDiscount;//折扣
    private String commodityDescription;//描述
    private Integer commodityRepertory;//库存
    private String commodityUrl;
    private Date time;
    private Integer status;

    public Commodity() {
    }

    public Commodity(Integer commodityId, String commodityName, Integer commodityPrice, Integer commodityDiscount, String commodityDescription, Integer commodityRepertory, String commodityUrl, Date time, Integer status) {
        this.commodityId = commodityId;
        this.commodityName = commodityName;
        this.commodityPrice = commodityPrice;
        this.commodityDiscount = commodityDiscount;
        this.commodityDescription = commodityDescription;
        this.commodityRepertory = commodityRepertory;
        this.commodityUrl = commodityUrl;
        this.time = time;
        this.status = status;
    }

    public Integer getCommodityId() {

        return commodityId;
    }

    public void setCommodityId(Integer commodityId) {
        this.commodityId = commodityId;
    }

    public String getCommodityName() {
        return commodityName;
    }

    public void setCommodityName(String commodityName) {
        this.commodityName = commodityName;
    }

    public Integer getCommodityPrice() {
        return commodityPrice;
    }

    public void setCommodityPrice(Integer commodityPrice) {
        this.commodityPrice = commodityPrice;
    }

    public Integer getCommodityDiscount() {
        return commodityDiscount;
    }

    public void setCommodityDiscount(Integer commodityDiscount) {
        this.commodityDiscount = commodityDiscount;
    }

    public String getCommodityDescription() {
        return commodityDescription;
    }

    public void setCommodityDescription(String commodityDescription) {
        this.commodityDescription = commodityDescription;
    }

    public Integer getCommodityRepertory() {
        return commodityRepertory;
    }

    public void setCommodityRepertory(Integer commodityRepertory) {
        this.commodityRepertory = commodityRepertory;
    }

    public String getCommodityUrl() {
        return commodityUrl;
    }

    public void setCommodityUrl(String commodityUrl) {
        this.commodityUrl = commodityUrl;
    }

    public Date getTime() {
        return time;
    }

    public void setTime(Date time) {
        this.time = time;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    @Override
    public boolean equals(Object o) {

        if (this == o) return true;
        if (o == null || getClass( ) != o.getClass( )) return false;

        Commodity commodity = (Commodity) o;

        if (commodityId != null ? !commodityId.equals(commodity.commodityId) : commodity.commodityId != null)
            return false;
        if (commodityName != null ? !commodityName.equals(commodity.commodityName) : commodity.commodityName != null)
            return false;
        if (commodityPrice != null ? !commodityPrice.equals(commodity.commodityPrice) : commodity.commodityPrice != null)
            return false;
        if (commodityDiscount != null ? !commodityDiscount.equals(commodity.commodityDiscount) : commodity.commodityDiscount != null)
            return false;
        if (commodityDescription != null ? !commodityDescription.equals(commodity.commodityDescription) : commodity.commodityDescription != null)
            return false;
        if (commodityRepertory != null ? !commodityRepertory.equals(commodity.commodityRepertory) : commodity.commodityRepertory != null)
            return false;
        if (commodityUrl != null ? !commodityUrl.equals(commodity.commodityUrl) : commodity.commodityUrl != null)
            return false;
        if (time != null ? !time.equals(commodity.time) : commodity.time != null) return false;
        return status != null ? status.equals(commodity.status) : commodity.status == null;
    }

    @Override
    public int hashCode() {
        int result = commodityId != null ? commodityId.hashCode( ) : 0;
        result = 31 * result + (commodityName != null ? commodityName.hashCode( ) : 0);
        result = 31 * result + (commodityPrice != null ? commodityPrice.hashCode( ) : 0);
        result = 31 * result + (commodityDiscount != null ? commodityDiscount.hashCode( ) : 0);
        result = 31 * result + (commodityDescription != null ? commodityDescription.hashCode( ) : 0);
        result = 31 * result + (commodityRepertory != null ? commodityRepertory.hashCode( ) : 0);
        result = 31 * result + (commodityUrl != null ? commodityUrl.hashCode( ) : 0);
        result = 31 * result + (time != null ? time.hashCode( ) : 0);
        result = 31 * result + (status != null ? status.hashCode( ) : 0);
        return result;
    }

    @Override
    public String toString() {
        return "Commodity{" +
                "commodityId=" + commodityId +
                ", commodityName='" + commodityName + '\'' +
                ", commodityPrice=" + commodityPrice +
                ", commodityDiscount=" + commodityDiscount +
                ", commodityDescription='" + commodityDescription + '\'' +
                ", commodityRepertory=" + commodityRepertory +
                ", commodityUrl='" + commodityUrl + '\'' +
                ", time=" + time +
                ", status=" + status +
                '}';
    }
}
